#include "setting.h"
#include "ui_setting.h"
#include <QBitmap>
#include <QPainter>
#include <QApplication>

Setting::Setting(bool state,QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Setting)
{
    pstate = state;
    ui->setupUi(this);
    setWindowFlags(Qt::FramelessWindowHint);
    if (pstate == false)
        ui->pushButton_2->setText("取消");
}

Setting::~Setting()
{
    delete ui;
}

void Setting::on_pushButton_2_clicked()
{
    if (pstate)
        QApplication::exit();
    else
        reject();
}

void Setting::on_pushButton_clicked()
{
    img_width = ui->width->value();
    img_height = ui->height->value();
    trans_flag = eyes_flag;
    accept();
}

void Setting::on_oneeyes_clicked()
{
    eyes_flag = true;
}

void Setting::on_twoeyes_clicked()
{
    eyes_flag = false;
}
